package com.kabigon.tiny;

import com.kabigon.tiny.service.ParentService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Map;

/**
 * @author xu.biao
 * @version v1.0
 * @Package com.kabigon.tiny
 * @data 2023-06-11 0:47
 */
public class Main {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        //HelloWorld helloWorld = context.getBean("helloWorld", HelloWorld.class);
        //System.out.println(helloWorld.getMessage());
        //
        //SomeService someService = context.getBean("someServiceImpl", SomeService.class);
        //someService.doSomethings();

        Map<String, ParentService> parentServiceMap = context.getBeansOfType(ParentService.class);
        System.out.println(parentServiceMap.toString());
        for (ParentService service : parentServiceMap.values()) {
            System.out.println(service);
            service.play();
        }


    }

}
